package com.yunmang.DaoUtils;

import android.content.Context;

/**
 * 将已创建的多表Manager对象封装在一个类
 * Created by Administrator on 2017/5/5.
 */
public class CommonDaoUtils {
    private static EndManager endManager;
    private static TransportManager transportManager;
    private static ArriveManager arriveManager;
    public  static Context context;
    public static void init(Context context){
        CommonDaoUtils.context = context.getApplicationContext();
    }
    /**
     * 单列模式获取EndManager对象
     * @return
     */
    public static  EndManager getEndManagerInstance(){
        if(endManager==null){
            endManager=new EndManager(context);
        }
        return endManager;
    }

    /**
     * 单列模式获取EndManager对象
     * @return
     */
    public static  TransportManager getTransportManager(){
        if(transportManager==null){
            transportManager=new TransportManager(context);
        }
        return transportManager;
    } /**
     * 单列模式获取EndManager对象
     * @return
     */
    public static  ArriveManager getArriveManager(){
        if(arriveManager==null){
            arriveManager=new ArriveManager(context);
        }
        return arriveManager;
    }
}
